<?php

/**
 * YZW与DZ操作的接口
 */
class DzAPI extends YzwBaseAPI {

    protected function __construct($userInfo = ''){
        parent::__construct($userInfo);
        $this->url = Yii::app()->params['bbsInfo']['url'] . "/yzw_api.php";;
    }
    /**
     * 发贴接口
     * arrData 里必须含有键值,fid,subject,message
     * @return [type]          
     */
    public function post($arrData) {
        if (empty($arrData['fid']) || empty($arrData['subject']) || empty($arrData['message'])) {
            $this->error = '缺少参数！';
            return false;
        }
        $arrData['action'] = 'post';
        $arrData['uid'] = $this->userInfo['uid'];
        $this->arrSendData = $arrData;
        return $this->sendCurl();
    }

    /**
     * 验证用户是否有在论坛激活
     * @return [type] [description]
     */
    public function canSunsingle() {
        $this->arrSendData = array(
            'username' => $this->userInfo['username'],
            'uid' => $this->userInfo['uid'],
            'action' => 'activation',
        );
        return $this->sendCurl();
    }
}
